package projbd;

import java.beans.Statement;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.OutputStreamWriter;
import java.io.UnsupportedEncodingException;
import java.io.Writer;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;

/**
 *
 * @author Matheus
 */
public class ReconstructXML {
    
    private static final String FIRST_INDEX = "1";
    private Writer xmlWriter;
    private String sqlStatement;
    private Statement statement;
    private Connection connection;
    
    public ReconstructXML(String file) throws UnsupportedEncodingException, FileNotFoundException, SQLException {
                
        connection = DriverManager.getConnection("jdbc:postgresql://localhost:5432/shakespeare", "postgres", "admin");
        xmlWriter = new OutputStreamWriter(new FileOutputStream(file), "UTF-8");
        reconstruct(FIRST_INDEX);
    }
    
    private void reconstruct(String index) {
        sqlStatement = "SELECT * FROM dewey_edges WHERE (dewey = " + index + ")";
        
    }
}
